package map;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.fasterxml.jackson.databind.ser.std.StdKeySerializers.Default;

public class LinkedHashMapTest {

    public static void main(String[] args) {
        Map<String, String> map = new LinkedHashMap<>(16, 0.75f, true);
        map.put("11111", "aaa");
        map.put("222", "bbb");
        map.put("3333", "ccc");
        Set<Entry<String, String>> set = map.entrySet();
        for (Entry<String, String> entry : set) {
            System.out.println(entry.getKey() + ":" + entry.getValue());
        }
        System.out.println("--------------");
        Map<String, String> map2 = new HashMap<>();
        map2.put("11111", "aaa");
        map2.put("222", "bbb");
        map2.put("3333", "ccc");
        Set<Entry<String, String>> set2 = map2.entrySet();
        for (Entry<String, String> entry : set2) {
            System.out.println(entry.getKey() + ":" + entry.getValue());
        }
        System.out.println("------------");
        System.out.println("11111".hashCode()^16);
        System.out.println("222".hashCode()^16);
        System.out.println("3333".hashCode()^16);
        System.out.println("-----------");
        System.out.println("11111".hashCode());
        System.out.println("222".hashCode());
        System.out.println("3333".hashCode());

        LinkedHashMapTest.A.say();
    }

    static int f(int a, int x) {
        if (a == 0)
            return 0;
        if (x == 0)
            return 1;
        if (x == 1)
            return a;
        return a * f(a, x - 1);
    }
    static int f2(int a, int x) {
        if (a == 0)
            return 0;
        if (x == 0)
            return 1;
        int sum = 1;
        for (int i = 1; i <= x; i++) {
            sum = a * sum;
        }
        return sum;
    }

    class AImpl implements A {

    }

    interface A {

        public static void say() {
            System.out.println("interface A say");
        }
    }

}
